﻿package bipede.animation 
{
	import flash.geom.Point;
	public class Pose
	{
		public var liste:Object = {};
		public function Pose() 
		{
		}
		public function append( name:String, position:Point ):void
		{
			//liste.push( new Node( name, position ) );
			liste[ name ] = position;
		}
		public function getPosition( name:String ):Point
		{
			return liste[ name ];
		}
		public function clone():Pose
		{
			var pose:Pose = new Pose();
			for ( var nom:String in liste ) pose.append( nom, liste[ nom ] ) ;
			return pose;
		}
		public function translation( p:Point ):Pose
		{
			var pose:Pose = new Pose();
			for ( var nom:String in liste ) pose.append( nom, (liste[ nom ] as Point).add( p ) );
			return pose;
		}
		public function toString():String
		{
			var t:String = "";
			for ( var nom:String in liste ) t += nom + " " + liste[ nom ] + "\r";
			return t;
		}
	}
}
/*
class Node
{
	public var name:String;
	public var position:Point;
	public function Node( _name:String, _position:Point )
	{
		position = _position;
		name = _name;
	}
	public function toString():String
	{
		return "Node : " + name + ", " + position;
	}	
}
*/